

ASFLAGS = -march=rv64gcv

AS = riscv64-unknown-elf-as
CC = riscv64-unknown-elf-gcc
LD = riscv64-unknown-elf-ld
DUMP = riscv64-unknown-elf-objdump
DUMP_FLAGS = -S

CFLAGSW_GCC = -Wall -Wextra -Wno-missing-field-initializers \
    -Wno-parentheses -Wno-missing-braces \
    -Wmissing-prototypes -Wfloat-equal \
    -Wwrite-strings -Wpointer-arith -Wcast-align \
    -Wnull-dereference \
    -Werror=multichar -Werror=sizeof-pointer-memaccess -Werror=return-type \
    -fstrict-aliasing

CFLAGS = $(CFLAGSW_GCC) $(CFLAGS0) $(CFLAGS1)



main: main.o demo.o 
	$(CC) $(LDFLAGS) $^ -o $@
	$(DUMP) $(DUMP_FLAGS) $@ > $@.dump

spike:
	spike --isa=RV64gcV --varch=vlen:128,elen:64  ../../pk/riscv64-unknown-elf/bin/pk main

spike-d:
	spike -d  --isa=RV64gcV --varch=vlen:128,elen:64  ../../pk/riscv64-unknown-elf/bin/pk main

#main1: main1.o demo1.o 
#	$(CC) $(LDFLAGS) $^ -o $@
#	$(DUMP) $(DUMP_FLAGS) $@ > $@.dump
#
#spike1:
#	spike --isa=RV64gcV --varch=vlen:128,elen:64  ../../pk/riscv64-unknown-elf/bin/pk main1






.PHONY: clean
clean:
	rm -f main.dump main main.o demo.o
